home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
COMAL
/
cboot.d64
/
plot'char.lst
< prev
next >
Wrap
File List
|
2009-01-23
|
2KB
|
108 lines
4000 // EDIT "PLOT'CHAR.LST"
4010 DIM DUMMY$ OF 25 // SPACE FOR SUB
4020 BUILD'SUB
4030 END
4040 PROC PLOT'CHAR(X,Y,C$,C'SET) CLOSED
4050 IF Y<7 OR Y>199 OR X<0 OR X>312 THEN GOTO EXIT
4060 IY:=199-INT(Y)
4070 P:=INT(X) MOD 8
4080 TWO'TO'P:=2^P; TWO'P'8:=2^(8-P)
4090 S:=7-(IY MOD 8)
4100 COLOR:=PEEK(53281)-240+16*PEEK(646)
4110 C'CD:=ORD(C$)
4120 IF C'CD=255 THEN C'CD:=126
4130 CASE (C'CD DIV 32) OF
4140 WHEN 0,4
4150 C'CD:=32
4160 WHEN 2,5,7
4170 C'CD:=C'CD-64
4180 WHEN 3
4190 C'CD:=C'CD-32
4200 WHEN 6
4210 C'CD:=C'CD-128
4220 OTHERWISE
4230 ENDCASE
4240 CASE C'SET OF
4250 WHEN 0
4260 BASE:=53248
4270 WHEN 1
4280 BASE:=54272
4290 WHEN 2
4300 BASE:=55296
4310 WHEN 3
4320 BASE:=56320
4330 OTHERWISE
4340 ENDCASE
4350 C'ADDR:=8*C'CD+BASE
4360 DIS'INT
4370 I'O:=PEEK(1)
4380 POKE 1,8*(I'O DIV 8)+(I'O MOD 4)
4390 CA:=C'ADDR; R:=IY
4400 CBA:=COLOR'BYTE'ADDR(X,R)
4410 POKE CBA,COLOR
4420 IF P<>0 THEN
4430 POKE CBA+1,COLOR
4440 ENDIF
4450 WHILE R<=IY+S DO
4460 DOTS:=PEEK(CA)
4470 CBA:=CELL'BYTE'ADDR(X,R)
4480 LB:=DOTS DIV TWO'TO'P
4490 AND'BYTE(CBA,LB)
4500 IF P<>0 THEN
4510 RB:=TWO'P'8*(DOTS-LB*TWO'TO'P)
4520 AND'BYTE(CBA+8,RB)
4530 ENDIF
4540 CA:=CA+1; R:=R+1
4550 ENDWHILE
4560 IF S<=7 THEN
4570 CBA:=COLOR'BYTE'ADDR(X,R)
4580 POKE CBA,COLOR
4590 IF P<>0 THEN
4600 POKE CBA+1,COLOR
4610 ENDIF
4620 WHILE R<=IY+7 DO
4630 DOTS:=PEEK(CA)
4640 CBA:=CELL'BYTE'ADDR(X,R)
4650 LB:=DOTS DIV TWO'TO'P
4660 AND'BYTE(CBA,LB)
4670 IF P<>0 THEN
4680 RB:=TWO'P'8*(DOTS-LB*TWO'TO'P)
4690 AND'BYTE(CBA+8,RB)
4700 ENDIF
4710 CA:=CA+1; R:=R+1
4720 ENDWHILE
4730 ENDIF
4740 POKE 1,PEEK(1)+4
4750 ENA'INT
4760 EXIT:
4770 ENDPROC PLOT'CHAR
4780 FUNC CELL'BYTE'ADDR(X,IY) CLOSED
4790 RETURN 57344+320*(IY DIV 8)+8*(X DIV 8)+(IY MOD 8)
4800 ENDFUNC CELL'BYTE'ADDR
4810 FUNC COLOR'BYTE'ADDR(X,IY) CLOSED
4820 RETURN 55296+40*(IY DIV 8)+X DIV 8
4830 ENDFUNC COLOR'BYTE'ADDR
4840 PROC DIS'INT CLOSED
4850 POKE 56334,2*(PEEK(56334) DIV 2)
4860 ENDPROC DIS'INT
4870 PROC ENA'INT CLOSED
4880 POKE 56334,PEEK(56334)+1
4890 ENDPROC ENA'INT
4900 PROC AND'BYTE(ADDR,BYTE) CLOSED
4910 POKE 251,(ADDR MOD 256)
4920 POKE 252,(ADDR DIV 256)
4930 POKE 253,BYTE
4940 SYS 45031
4950 ENDPROC AND'BYTE
4960 PROC BUILD'SUB CLOSED
4970 B:=45031
4980 FOR A:=B TO B+24 DO
4990 READ N
5000 POKE A,N
5010 ENDFOR A
5020 DATA 120,165,1,133,254,41,249
5030 DATA 9,1,133,1,160,0,177,251
5040 DATA 5,253,145,251
5050 DATA 165,254,133,1,88,96
5060 ENDPROC BUILD'SUB